package org.bozo.im.activity.roster;

import java.util.Comparator;

public class ContactComparator implements Comparator<ContactAggregator> {

	public int compare(ContactAggregator pContact1, ContactAggregator pContact2) {
		
		int lPriorityDif = pContact1.getPresence().getPriority() - pContact2.getPresence().getPriority();
		
		if (lPriorityDif != 0)
			return lPriorityDif;
		
		return pContact1.getDisplayName().compareTo(pContact2.getDisplayName());
	}

}
